﻿using System;
using System.IO;
using System.Web;

namespace WebCommon
{
    public static partial class SharedFunction
    {
        public static void Download(string sFileName, string sFilePath)
        {
            HttpContext.Current.Response.ContentType = "APPLICATION/PDF";
            String Header = "Attachment; Filename=" + sFileName;
            HttpContext.Current.Response.AppendHeader("Content-Disposition", Header);
            HttpContext.Current.Response.Cache.SetCacheability(HttpCacheability.NoCache);
            var stringWrite = new FileStream(sFilePath,FileMode.Append);
            HttpContext.Current.Response.WriteFile(sFileName);
            HttpContext.Current.Response.End();
        }
    }
}
